package com.kly.sc.api.application.service.user;

import com.kly.sc.api.application.helper.RequestLocalInfo;
import com.kly.user.dto.UserConversationDto;
import com.kly.user.dto.UserConversationRecordDto;
import com.kly.user.service.UserConversationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ScUserConversationService {

    @Resource
    UserConversationService userConversationService;

    public void saveUserConversationRecord(UserConversationRecordDto userConversation) {
        userConversationService.addUserConversation(userConversation);
    }

    public void addUserConversationRecordList(List<UserConversationRecordDto> UserRecordList) {
        userConversationService.addUserConversationList(UserRecordList);
    }


    public Map<Integer, List<UserConversationRecordDto>> getUserRecordListMap(String userCode, String toUserCode,Integer type) {
        Map<String, Object> params = new HashMap<>();
        params.put("deleted", 0);
        params.put("userCode", userCode);
        params.put("toUserCode", toUserCode);
        params.put("conversationsAttributes", type);
        return userConversationService.getUserConversationList(params);
    }

    public UserConversationDto getUserConversation(String userCode, String toUserCode){
        return userConversationService.getUserConversation(userCode,toUserCode);
    }


}
